<?php
class Codevalue_model extends CI_Model{

    function __construct()
    {
        parent::__construct();
    }
    
    function getCodeValueList($name){
    	if(empty($name))return null;
    	
    	$this->db->where('name',$name);
    	$this->db->order_by('sort','asc');
    	
    	return $this->db->get('codevalue')->result_array();
    }
    
 	function getCodeValue($name,$code){
    	if(empty($name))return null;
    	
    	$this->db->where('name',$name);
    	$this->db->where('code',$code);
    	$this->db->order_by('sort','asc');
    	
    	return $this->db->get('codevalue')->row_array();
    }
}